
{extend name='public/base' /}

{block name="content"}

<style type="text/css">
		table {
			border-collapse: collapse;
			text-align: center;
			min-width: 600px;
		}

		table td {
			border: 0.5px solid #ccc;
			color: #000000;
			height: 30px;
			font-size: 13px;
			text-align: left;
		}

		table th {
			border: 0.5px solid #ccc;
			color: #000000;
			height: 30px;
			font-weight: 600;
			font-size: 15px;
		}

		table thead th {
			width: 100px;
		}

	</style>
<div class="layui-fluid" id="html">
	<div>
	<div style="width: 96%;display: flex;align-items: center;justify-content: space-between;margin: 0 auto">
		<h3 style="font-weight: bold">收款</h3>
		<div>
			<div>开具时间:{$result.time}</div>
			<div>单据号码:{$result.No}</div>
		</div>

	</div>
	<table class="layui-table">
		<tbody>
		<tr>
			<td  colspan="2">收据方:{$result.shoujufang}</td>
		</tr>
		<tr>
			<td>合计金额:(大写):{$result.zje}</td>
			<td>合计金额:(小写):{$result.amount}</td>
		</tr>
		<tr>
			<td>支付流水号:{$result.liushui}</td>
			<td>费用项流水号:{$result.cost_sn}</td>
		</tr>
		<tr>
			<td>铺位编号:{$result.positions_code}</td>
			<td>签约品牌:{$result.brand}</td>
		</tr>
		<tr>
			<td>合同签约方:{$result.tenant_name}</td>
			<td>合同编号:{$result.code}</td>
		</tr>
		<tr>
			<td>实际付款方:{$result.tenant_name}</td>
			<td>收款方式:{$result.pay_way}</td>
		</tr>
		<tr>
			<td colspan="2">收款事由:{$result.title}</td>
		</tr>
		<tr>
			<td colspan="2">备注:{$result.remark}</td>
		</tr>
		</tbody>
	</table>
	<div style="text-align: right;margin-top: 10px">收款方:{$result.company}</div>
	<div>
		<img  style="width: 200px;height: 200px;border-radius: 50%;overflow: hidden;position: absolute;top: 30%;right: 0" src="{$result.image}" alt="">
	</div>
		{if $result.pay_status==-1}
		<div>已退费</div>
		{/if}
	</div>
</div>

<button id="print">打印</button>
{/block}

{block name="js"} <!--js处理区-->


<script>
    layui.use(['element', 'table', 'form', 'jquery', 'lucky','opTable'], function () {
        var element = layui.element;
        var form = layui.form;
        var $ = layui.jquery;
        var lucky=layui.lucky;
        var opTable = layui.opTable;
        var table = layui.table;
        form.render();
        $('#print').click(function (){
			var id = "{$id}"
			$.ajax({
				url:"{:url('Printsum')}",
				type:"post",
				data: {'id':id},
				dataType:"json",
				success:function(data){
					if(data.code == 1){
						layer.msg(data.msg, {icon: 5, time: 1000});
					}else{
						console.log($('#html').html())
						$('#print_number').html(data.data.print_number);
						window.document.body.innerHTML=$('#html').html();
						window.print();
					}
				}
			});

        })
		
		$("tbody tr").find("td:eq(6)").each(function(i,el){
		           var td = parseFloat($(el).text());
		           if(!isNaN(td)){
		              $(el).text(td.toFixed(2));
		           }
		    }); 
    });

</script>

{/block}
